package tech.aistar.day12.exception;

/**
 * 本类用来演示:
 *
 * @author: success
 * @date: 2021/3/23 3:11 下午
 */
public class TestAccount {
    public static void main(String[] args) {
        try {
            save(-10.0d);
        } catch (MoneyNotLtZeroException e) {
            e.printStackTrace();
        }
    }

    public static void save(double money) throws MoneyNotLtZeroException {
        if(money<=0){
            //System.out.println("存款不能为负数!");

            throw new MoneyNotLtZeroException("存款不能为负数!");
           // System.out.println("===");
        }
        System.out.println(money);
    }
}
